---
title: 'Prometheus'
description: 'Configuring the Prometheus backend (Self-Hosted)'
sidebarTitle: 'Prometheus'
icon: 'signal-stream'
---

### Getting Started

<img src="https://d15jtxgb40qetw.cloudfront.net/prometheus.svg" alt="prometheus" className="not-prose h-20" />

{/*
    Add custom content here (under this comment)...

    e.g.

    **Creating Account**<br />
    Go to the **[🔗 website](https://odigos.io) > Account** and click **Sign Up**

    **Obtaining Access Token**<br />
    Go to **⚙️ > Access Tokens** and click **Create New**

    !! Do not remove this comment, this acts as a key indicator in `docs/sync-dest-doc.py` !!
    !! START CUSTOM EDIT !!
*/}

<Note>
  These instructions are for the **self hosted** Prometheus instance. If you need a managed service, please follow the instructions on the [Grafana Cloud Prometheus](/backends/grafanacloudprometheus) page.
</Note>

**Enabling Remote Write in Prometheus**<br />
Currently, Odigos supports Prometheus via the Remote Write API. In order to enable remote write in Prometheus, set [the following feature flag](https://prometheus.io/docs/prometheus/latest/feature_flags/#remote-write-receiver).

{/*
    !! Do not remove this comment, this acts as a key indicator in `docs/sync-dest-doc.py` !!
    !! END CUSTOM EDIT !!
*/}

### Configuring Destination Fields

<Accordion title="Supported Signals:">
  ❌ Traces
  ✅ Metrics
  ❌ Logs
</Accordion>

- **PROMETHEUS_REMOTEWRITE_URL** `string` : Remote Write URL.
  - This field is required
- **PROMETHEUS_RESOURCE_ATTRIBUTES_LABELS** `string[]` : Resource Attributes Labels (Deprecated). deprecated. will be removed soon.
  - This field is optional
- **PROMETHEUS_BEARER_TOKEN** `string` : Bearer Token. use this bearer token if your prometheus remote write endpoint requires authentication
  - This field is optional
  - Example: `your-bearer-token`

### Adding Destination to Odigos

There are two primary methods for configuring destinations in Odigos:

##### **Using the UI**

<Steps>
  <Step>
    Use the [Odigos CLI](https://docs.odigos.io/cli/odigos_ui) to access the UI
    ```bash
    odigos ui
    ```
  </Step>
  <Step>
    Click on `Add Destination`, select `Prometheus` and follow the on-screen instructions
  </Step>
</Steps>

##### **Using Kubernetes manifests**

<Steps>
  <Step>
    Save the YAML below to a file (e.g. `prometheus.yaml`)
    ```yaml
    apiVersion: odigos.io/v1alpha1
    kind: Destination
    metadata:
      name: prometheus-example
      namespace: odigos-system
    spec:
      data:
        PROMETHEUS_REMOTEWRITE_URL: <Remote Write URL>
        # Note: The commented fields below are optional.
        # PROMETHEUS_RESOURCE_ATTRIBUTES_LABELS: <Resource Attributes Labels (Deprecated)>
      destinationName: prometheus
      # Uncomment the 'secretRef' below if you are using the optional Secret.
      # secretRef:
      #   name: prometheus-secret
      signals:
      - METRICS
      type: prometheus

    ---

    # The following Secret is optional. Uncomment the entire block if you need to use it.
    # apiVersion: v1
    # data:
    #   PROMETHEUS_BEARER_TOKEN: <Base64 Bearer Token>
    # kind: Secret
    # metadata:
    #   name: prometheus-secret
    #   namespace: odigos-system
    # type: Opaque
    ```
  </Step>
  <Step>
    Apply the YAML using `kubectl`
    ```bash
    kubectl apply -f prometheus.yaml
    ```
  </Step>
</Steps>